package com.alkaid.commons.entity;

import com.alkaid.commons.param.anime.AnimeCommentGroup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @author Kylin
 * 评论表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "t_comment")
public class Comment implements Serializable {
    @TableId
    private Long id;
    private Long userId;
    @NotNull(message = "参数不能为空")
    private Integer animeId;
    @Size(min = 2, max = 500, message = "评论应在2-500字之间", groups = AnimeCommentGroup.class)
    private String content;
    private Date sendTime;
    @TableField(exist = false)
    private String nickname;
    @TableField(exist = false)
    private String avatar;
}
